home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Windows News 2010 Summer - Disc 1
/
WN_Ete2010_CD1.iso
/
Onglet5
/
Weezo
/
Weezo setup.exe
/
{code_appDir}
/
www
/
js
/
viewImage.js
< prev
next >
Wrap
Text File
|
2010-05-19
|
20KB
|
1 lines
var controlsLocked=0;var dragging=false;var requestInProgress=0;var fileTotal=0;var filePos=0;var border=10;var slideshowRunning=0;var slideShowTimer;var prevPreloaded=0;var nextPreloaded=0;var imgLoaded=0;var toggleZoomLocked=0;var loadBuffer;var fw;var fh;var rw;var rh;var w;var h;var rot=0;var pfw;var pfh;var nfw;var nfh;var nw;var nh;var pw;var ph;var pTitle;var nTitle;var aw;var ah;var at;var al;var zooming=0;var slideAnimCompleted=1;var slideAbort=0;var skipImages=0;var sx;var sy;var ex;var ey;function next(){controlsLocked=1;didZoom=0;requestInProgress++;submitFrm("next")}function prev(){controlsLocked=1;didZoom=0;requestInProgress++;submitFrm("prev")}function init(){if(window.orientation!==undefined){updateOrientation()}else{resetArea()}if(zoom=="resized"){dd.elements.imgDiv.setInertia(false);dd.elements.imgNextDiv.setInertia(false);dd.elements.imgPrevDiv.setInertia(false)}submitFrm("view");if(slideshow){slideshowResume()}}function setImageData(e,b,a,d,f,c){setTitle(e);setFilePos(f,c);D.comForm.data2.value=b;if(a&&d){fw=a;fh=d}}function setTitle(a){dgi("viewImageTitle").innerHTML=a;winMe.setCaption(a)}function setFilePos(a,b){if(b){fileTotal=b}if(a=="+"){filePos++;if(filePos>fileTotal){filePos=1}}else{if(a=="-"){filePos--;if(filePos<1){filePos=fileTotal}}else{filePos=a}}dgi("filePosDiv").innerHTML=filePos+"/"+fileTotal}function setLoading(a){}function buttonPrev(){if(!slideAnimCompleted){slideAbort--}if(controlsLocked||(!slideAnimCompleted)||zooming||dragging){return}if(zoom=="full"){slideAnim(1,"prev",0)}else{slideAnim(slideSteps-1,"prev",aw/2+al-w/2)}}function buttonNext(){if(!slideAnimCompleted){slideAbort++}if(controlsLocked||(!slideAnimCompleted)||zooming||dragging){return}if(slideShowTimer){slideShowTimer=clearTimeout(slideShowTimer)}if(zoom=="full"){slideAnim(1,"next",0)}else{slideAnim(slideSteps-1,"next",aw/2+al-w/2)}}function rotateLeft(){submitFrm("rotate"+((rot==0)?270:(rot-90)))}function rotateRight(){submitFrm("rotate"+((rot==270)?0:(rot+90)))}function resizeImg(c,b,a){if(!b||!a){return}dd.elements[c+"Div"].resizeTo(b,a);dgi(c).style.width=b+"px";dgi(c).style.height=a+"px";if(c=="img"){w=b;h=a}}function resetArea(){var b=winMe.getInnerHeight();var a=winMe.getInnerWidth();if(window.orientation!==undefined&&zoom=="resized"){var c=dgn("viewport").getAttribute("content");if(c.indexOf("width=")){c=c.substr(c.indexOf("width=")+6);if(c.indexOf(",")){c=c.substr(0,c.indexOf(","))}c=c.replace(/ /,"");if(c=="device-width"){c=(iorient()?480:268)}a=c}c=dgn("viewport").getAttribute("content");if(c.indexOf("height=")){c=c.substr(c.indexOf("height=")+7);if(c.indexOf(",")){c=c.substr(0,c.indexOf(","))}c=c.replace(/ /,"");if(c=="device-height"){c=(iorient()?320:416)}b=c}}if(window.orientation!==undefined&&zoom=="full"&&fw&&fh){a=fw;b=fh}setActualHeight(dgi("scrollDiv"),b-actualOffsetTop(dgi("scrollDiv")));aw=a;ah=b-actualOffsetTop(dgi("scrollDiv"));al=0;at=actualOffsetTop(dgi("scrollDiv"));dd.recalc()}function winResized(d,b){if(window.orientation!==undefined&&d!==undefined){return}resetArea();var c=rw;var a=rh;dims=resizedDimensions(fw,fh);rw=dims[0];rh=dims[1];if((c<rw||a<rh)&&!imgFullSizeLoaded){dgi("img").src=imgURL.replace(/<WIDTH>/,rw).replace(/<HEIGHT>/,rh).replace(/<ANGLE>/,rot)}if(zoom=="resized"){resizeImg("img",rw,rh);centerImg()}else{dd.obj=dd.elements.imgDiv;duringDrag();dd.obj=null}dims=resizedDimensions(nfw,nfh);nw=dims[0];nh=dims[1];resizeImg("imgNext",nw,nh);dims=resizedDimensions(pfw,pfh);pw=dims[0];ph=dims[1];resizeImg("imgPrev",pw,ph);setPrevPos(!dragging);setNextPos(!dragging)}function winStateChanged(b,a){if(b==a){return}if(a=="max"){winMe.setBorderless()}else{winMe.resetBorders()}if(winMe.isFrameless()){dgi("normalSizeButton").style.display=((a=="max")?"":"none");dgi("normalSizeButton2").style.display=((a=="max")?"":"none")}}function centerImg(){dd.elements.imgDiv.moveTo(al+aw/2-w/2,at+ah/2-h/2)}function setNextPos(a){if(a){dd.elements.imgNextDiv.moveTo(aw+1000,ah/2+at-nh/2)}else{dd.elements.imgNextDiv.moveTo(dd.elements.imgDiv.x+w/2+aw-nw/2,ah/2+at-nh/2)}}function setPrevPos(a){if(a){dd.elements.imgPrevDiv.moveTo(-2000-aw,ah/2+at-ph/2)}else{dd.elements.imgPrevDiv.moveTo(dd.elements.imgDiv.x+w/2-aw-pw/2,ah/2+at-ph/2)}}function toggleZoom(b,c){if(toggleZoomLocked){return}if(!c&&(dragCancelOnclick||zooming||dragging||slideshow||mouseY<at||mouseY<dgi("headerNormal").offsetHeight*1.5||controlsLocked)){return false}toggleZoomLocked=1;setTimeout("toggleZoomLocked=0",50);if(bDrag&&zoom=="resized"&&!c){if(mouseX<aw/4+al){buttonPrev();return true}if(mouseX>3*aw/4+al){buttonNext();return true}}if(zoom=="resized"&&rw==fw){return false}zooming=1;sx=dd.elements.imgDiv.x;sy=dd.elements.imgDiv.y;dd.elements.imgDiv.setDraggable(false);dd.elements.imgNextDiv.setDraggable(false);dd.elements.imgPrevDiv.setDraggable(false);if(zoom=="full"){ex=Math.floor(aw/2-rw/2)+al;ey=Math.floor(ah/2-rh/2)+at;setTimeout("submitFrm('resized')",100);zoomAnim(zoomSteps,-1);if(bBrowser=="iPhone"){dd.disabled=0}}else{var a=-fw*((mouseX-actualOffsetLeft(dgi("imgDiv")))/w-0.5);var d=-fh*((mouseY-actualOffsetTop(dgi("imgDiv")))/h-0.5);if(b){a=0;d=0}ex=a+aw/2+al-fw/2;ey=d+ah/2+at-fh/2;if(ex>al||ex<aw-fw+al){ex=(Math.max(Math.min(ex,0),aw-fw+al))}if(ey>at||ey<ah-fh+at){ey=(Math.max(Math.min(ey,at),ah-fh+at))}if(fw<=aw){ex=aw/2+al-fw/2}if(fh<=ah){ey=ah/2+at-fh/2}if(!imgFullSizeLoaded&&rw<fw){dgi("imgCacheFull").src=resizedURL(imgURLFull,0,0,rot);setLoading(1)}setPrevPos(1);setNextPos(1);setTimeout("submitFrm('fullsize')",100);zoomAnim(0,1);dd.moveFunc=function(f){return true};if(bBrowser=="iPhone"){dd.disabled=1}}return true}function zoomAnim(c,b){if((b<0&&c==0)||(b>0&&c==zoomSteps)){if(b>0){zoom="full"}else{zoom="resized"}zooming=0;didZoom=1;if(!slideshow){dd.elements.imgDiv.setDraggable(true);dd.elements.imgNextDiv.setDraggable(true);dd.elements.imgPrevDiv.setDraggable(true)}dd.elements.imgDiv.setInertia(zoom=="full");dd.elements.imgNextDiv.setInertia(zoom=="full");dd.elements.imgPrevDiv.setInertia(zoom=="full");if(adaptViewport){if(zoom=="full"){dgn("viewport").setAttribute("content","width="+fw+", height="+fh+", user-scalable=yes");dgi("imageFrameBody").style.overflow="";dgi("frame1").style.overflow="";D.body.style.width=fw+"px";D.body.style.height=fh+"px"}else{if(iorient()==0){dgn("viewport").setAttribute("content","width=320, height=416, user-scalable=no, minimum-scale=1, maximum-scale=1, initial-scale=1");D.body.style.width="320px";D.body.style.height="416px"}if(iorient()==1){dgn("viewport").setAttribute("content","width=480, height=268, user-scalable=no, minimum-scale=1, maximum-scale=1, initial-scale=1");D.body.style.width="480px";D.body.style.height="268px"}dgi("imageFrameBody").style.overflow="hidden";dgi("frame1").style.overflow="hidden"}winResized()}return}c+=b;var a=(b>0)?c/zoomSteps:((zoomSteps-c)/zoomSteps);w=rw+(fw-rw)*c/zoomSteps;h=rh+(fh-rh)*c/zoomSteps;resizeImg("img",w,h);dd.elements.imgDiv.moveTo((sx+(ex-sx)*a),(sy+(ey-sy)*a));setTimeout("zoomAnim("+c+","+b+")",1)}function slideAnim(d,b,a){d--;if(zoom=="resized"){if(b=="cancel"){targetX=(al+aw/2-w/2)}else{if(b=="next"){targetX=(al+aw/2-w/2-aw)}else{if(b=="prev"){targetX=(al+aw/2-w/2+aw)}}}var c=Math.pow(d/slideSteps,((b=="cancel")?3:2));dd.elements.imgDiv.moveTo(targetX+(a-targetX)*c,at+ah/2-h/2);setNextPos();setPrevPos()}slideAnimCompleted=0;if(slideAbort){d=0}if(d<=0){dragging=0;loadBuffer=0;disableImgOnload=1;dgi("imgCacheFull").src="";if(requestInProgress>0&&!slideAbort){wl.asr.cancelAll();skipImages+=(b=="next")?1:-1;requestInProgress--}if(b=="prev"){nTitle=dgi("viewImageTitle").innerHTML;setTitle(pTitle);setFilePos("-");if(!slideAbort){prev()}dgi("imgNext").src=dgi("img").src;resizeImg("imgNext",w,h);nfw=fw;nfh=fh;nw=w;nh=h;imgLoaded=0;swapImgs("imgPrev","img");fw=pfw;fh=pfh;dims=resizedDimensions(fw,fh);rw=dims[0];rh=dims[1];if(zoom=="resized"){w=pw;h=ph}else{w=fw;h=fh}if(zoom=="full"){resizeImg("img",w,h)}centerImg();dgi("imgPrev").style.visibility="hidden";dgi("imgPrev").src=emptySrc;dgi("imgCachePrev").src=emptySrc;prevPreloaded=false;nextPreloaded=true}if(b=="next"){pTitle=dgi("viewImageTitle").innerHTML;setTitle(nTitle);setFilePos("+");if(!slideAbort){next()}dgi("imgPrev").src=dgi("img").src;resizeImg("imgPrev",w,h);pfw=fw;pfh=fh;pw=w;ph=h;imgLoaded=0;swapImgs("img","imgNext");fw=nfw;fh=nfh;dims=resizedDimensions(fw,fh);rw=dims[0];rh=dims[1];if(zoom=="resized"){w=nw;h=nh}else{w=fw;h=fh}if(zoom=="full"){resizeImg("img",w,h)}centerImg();dgi("imgNext").style.visibility="hidden";dgi("imgNext").src=emptySrc;dgi("imgCacheNext").src=emptySrc;prevPreloaded=true;nextPreloaded=false}setPrevPos(1);setNextPos(1);slideAnimCompleted=1;disableImgOnload=0;if(slideAbort){if(slideAbort>0){slideAbort--;skipImages++;if(zoom=="full"){slideAnim(1,"next",0)}else{slideAnim(slideSteps-1,"next",aw/2+al-w/2)}}else{slideAbort++;skipImages--;if(zoom=="full"){slideAnim(1,"prev",0)}else{slideAnim(slideSteps-1,"prev",aw/2+al-w/2)}}}}else{setTimeout("slideAnim("+d+',"'+b+'",'+a+")",1)}}function swapImgs(c,b){dgi(c).id="swapId";dgi(b).id=c;dgi("swapId").id=b;dgi(c+"Div").id="swapId";dgi(b+"Div").id=c+"Div";dgi("swapId").id=b+"Div";var a=dd.elements[b+"Div"];dd.elements[b+"Div"]=dd.elements[c+"Div"];dd.elements[c+"Div"]=a}function my_asUpdt(a,b){sTimeout=b*1000;if(slideshowRunning&&slideShowTimer){clearTimeout(slideShowTimer);slideShowTimer=setTimeout("buttonNext()",sTimeout)}dgi("asUpdt"+SLIDESHOW_TIMER_CONTROL_NAME+"_thumb").title=b+secCaption;dgn("asUpdt"+SLIDESHOW_TIMER_CONTROL_NAME).title=b+secCaption}function duringDrag(){if(dd.obj.name!="imgDiv"&&dd.obj.name!="imgPrevDiv"&&dd.obj.name!="imgNextDiv"){return}if(zooming){return}if(zoom=="resized"){dragging=1;var e=dd.obj.pickX+((mouseX-dd.obj.pickMouseX<0)?-1:1)*Math.pow(Math.abs(mouseX-dd.obj.pickMouseX),1);e=Math.max(Math.min(e,3*aw/2-w/2),-w/2-aw/2);dd.obj.moveTo(e,at+ah/2-h/2);setNextPos();setPrevPos()}else{if(adaptViewport){var c=dd.obj.x;var a=dd.obj.y;dd.obj.moveTo(al,at);window.scrollTo(-c-al,-a-at);return}var d=dd.obj.x;var b=dd.obj.y;if((dd.obj.x>al||dd.obj.x<aw+al-w)&&fw>aw){d=Math.max(Math.min(dd.obj.x,al),aw+al-w)}else{if(fw<aw){d=aw/2+al-fw/2}}if((dd.obj.y>at||dd.obj.y<ah+at-h)&&fh>ah){b=Math.max(Math.min(dd.obj.y,at),ah+at-h)}else{if(fh<ah){b=ah/2+at-fh/2}}if(d!=dd.obj.x||b!=dd.obj.y){dd.obj.moveTo(d,b)}}}function preDrop(){if(zoom=="full"||slideshow){return}var a=(new Date()).getTime()-dd.obj.pickDate;if(dragging&&a<300&&Math.abs(dd.obj.mdx)<=30){if(toggleZoom(0,1)){dragging=0;return}}if(!dragging){return}if(dd.obj.mdx>0.3*aw||(dd.obj.mdx>30&&a<300)){slideAnim(slideSteps-1,"prev",dd.obj.x)}else{if(dd.obj.mdx<-0.3*aw||(dd.obj.mdx<-30&&a<300)){slideAnim(slideSteps-1,"next",dd.obj.x)}else{slideAnim(slideSteps-1,"cancel",dd.obj.x)}}}function submitFrm(a){fillAndSubmit(undefined,undefined,a+((skipImages!=0)?"/"+skipImages:""),(aw-border)+"x"+(ah-border),true)}function resizedDimensions(a,e){var c=(aw-border);var f=(ah-border);var d=a/e;var b=c/f;if(d>=b){resW=c;resH=c/d}else{resW=f*d;resH=f}if(resW>a){resW=a;resH=e}resW=Math.floor(resW);resH=Math.floor(resH);return new Array(resW,resH)}function resizedURL(j,b,d,l,i){if(l==undefined){l=0}var f,a;if(!b||!d){f=0;a=0}else{var c=(aw-border);var k=(ah-border);if(i){c/=4;k/=4}var g=b/d;var e=c/k;if(g>=e){f=c;a=c/g}else{f=k*g;a=k}if(f>=b){f="";a=""}f=Math.floor(f);a=Math.floor(a)}return j.replace(/<WIDTH>/,f).replace(/<HEIGHT>/,a).replace(/<ANGLE>/,l)}var disableImgOnload=0;function loaded(c){if(disableImgOnload){return}var a=dgi(c);if(!a.src||a.src.indexOf("/gfx/v.gif")!=-1){return}switch(c){case"img":dgi("img").style.visibility="visible";setLoading(false);imgLoaded=1;if(slideshowRunning&&!slideShowTimer){slideShowTimer=setTimeout("buttonNext()",sTimeout)}if(phpBrowser=="opera"){return}break;case"imgCacheFull":dgi("img").src=a.src;resizeImg("img",w,h);dgi("img").style.visibility="visible";setLoading(false);imgLoaded=1;imgFullSizeLoaded=1;a.src="";return;break;case"imgNext":var b=resizedDimensions(nfw,nfh);nw=b[0];nh=b[1];if(!dragging){setNextPos(1)}else{setNextPos()}resizeImg("imgNext",nw,nh);dgi("imgNext").style.visibility="visible";nextPreloaded=true;break;case"imgPrev":var b=resizedDimensions(pfw,pfh);pw=b[0];ph=b[1];if(!dragging){setPrevPos(1)}else{setPrevPos()}resizeImg("imgPrev",pw,ph);dgi("imgPrev").style.visibility="visible";prevPreloaded=true;break;case"imgCacheNext":dgi("imgNext").src=dgi("imgCacheNext").src;nextPreloaded=true;break;case"imgCachePrev":dgi("imgPrev").src=dgi("imgCachePrev").src;prevPreloaded=true;break}proceedLoadBuffer()}function proceedLoadBuffer(){if(!loadBuffer||loadBuffer.length==0){return}switch(loadBuffer.shift()){case"prevSmall":if(reducedPreview){dgi("imgPrev").src=resizedURL(imgURLPrev,pfw,pfh,0,true)}break;case"prevResized":dgi("imgCachePrev").src=resizedURL(imgURLPrev,nfw,nfh);break;case"prevFull":dgi("imgCachePrev").src=resizedURL(imgURLPrev,0,0);break;case"nextSmall":if(reducedPreview){dgi("imgNext").src=resizedURL(imgURLNext,nfw,nfh,0,true)}break;case"nextResized":dgi("imgCacheNext").src=resizedURL(imgURLNext,nfw,nfh);break;case"nextFull":dgi("imgCacheNext").src=resizedURL(imgURLNext,0,0);break}}function loadProceed(b){setLoading(true);var a;if(zoom=="resized"){imgFullSizeLoaded=false;c=resizedDimensions(fw,fh);rw=c[0];rh=c[1];resizeImg("img",rw,rh);centerImg();if(rw==fw&&rh==fh){a=resizedURL(imgURLFull,0,0,rot)}else{a=resizedURL(imgURL,fw,fh,rot)}}else{imgFullSizeLoaded=true;w=fw;h=fh;resizeImg("img",fw,fh);centerImg();c=resizedDimensions(fw,fh);rw=c[0];rh=c[1];a=resizedURL(imgURLFull,0,0,rot)}dgi("img").src=a;if(adaptViewport){updateOrientation()}var c=resizedDimensions(nfw,nfh);nw=c[0];nh=c[1];resizeImg("imgNext",nw,nh);setNextPos();c=resizedDimensions(pfw,pfh);pw=c[0];ph=c[1];resizeImg("imgPrev",pw,ph);setPrevPos();if(b){if(reducedPreview){loadBuffer=new Array("nextSmall","prevSmall","nextResized","prevResized")}else{loadBuffer=new Array("nextResized","prevResized")}}controlsLocked=0;if(phpBrowser=="opera"){proceedLoadBuffer()}}function nextProceed(b){skipImages=0;if(requestInProgress>0){requestInProgress--}if(!slideAnimCompleted){return}if(!slideAnimCompleted){return setTimeout("nextProceed("+b+")",10)}if(!imgLoaded){setLoading(true)}if(reducedPreview){loadBuffer=new Array("nextSmall",(zoom=="full")?"nextFull":"nextResized")}else{loadBuffer=new Array((zoom=="full")?"nextFull":"nextResized")}var d;if(b){d=resizedDimensions(fw,fh);rw=d[0];rh=d[1];if(zoom=="resized"){resizeImg("img",rw,rh);centerImg()}}d=resizedDimensions(nfw,nfh);nw=d[0];nh=d[1];resizeImg("imgNext",nw,nh);setNextPos();controlsLocked=0;var a;var c=0;if(zoom=="resized"){imgFullSizeLoaded=0;if(rw==fw&&rh==fh){a=resizedURL(imgURLFull,0,0,rot)}else{a=resizedURL(imgURL,fw,fh,rot)}dgi("img").src=a;while(dgi("img").src.indexOf("%3CANGLE%")!=-1&&++c<10){dgi("img").src=a}}else{if(!zooming&&!didZoom){w=fw;h=fh;centerImg()}a=resizedURL(imgURLFull,0,0,rot);dgi("imgCacheFull").src=a;while(dgi("imgCacheFull").src.indexOf("%3CANGLE%")!=-1&&++c<10){dgi("imgCacheFull").src=a}}if(adaptViewport){updateOrientation()}if(imgLoaded||phpBrowser=="opera"||bBrowser=="iPhone"){setLoading(false);proceedLoadBuffer()}}function prevProceed(b){if(requestInProgress>0){requestInProgress--}skipImages=0;if(!slideAnimCompleted){return setTimeout("prevProceed("+b+")",10)}if(!imgLoaded){setLoading(true)}if(reducedPreview){loadBuffer=new Array("prevSmall",(zoom=="full")?"prevFull":"prevResized")}else{loadBuffer=new Array((zoom=="full")?"prevFull":"prevResized")}var d;if(b){d=resizedDimensions(fw,fh);rw=d[0];rh=d[1];if(zoom=="resized"){resizeImg("img",rw,rh);centerImg()}}d=resizedDimensions(pfw,pfh);pw=d[0];ph=d[1];resizeImg("imgPrev",pw,ph);setPrevPos();controlsLocked=0;var a;var c=0;if(zoom=="resized"){imgFullSizeLoaded=false;if(rw==fw&&rh==fh){a=resizedURL(imgURLFull,0,0,rot)}else{a=resizedURL(imgURL,fw,fh,rot)}dgi("img").src=a;while(dgi("img").src.indexOf("%3CANGLE%")!=-1&&++c<10){dgi("img").src=a}}else{if(!zooming&&!didZoom){w=fw;h=fh;centerImg()}a=resizedURL(imgURLFull,0,0,rot);dgi("imgCacheFull").src=a;while(dgi("imgCacheFull").src.indexOf("%3CANGLE%")!=-1&&++c<10){dgi("imgCacheFull").src=a}}if(adaptViewport){updateOrientation()}if(imgLoaded||phpBrowser=="opera"||bBrowser=="iPhone"){setLoading(false);proceedLoadBuffer()}}function toggleSlideshow(ns){if(slideshow==ns){return}if(!slideshow&&zoom=="full"){toggleZoom(true,true)}slideshow=ns;var tmpH=dgi("headerNormal").offsetHeight;dgi("headerNormal").style.display=((slideshow)?"none":"");dgi("headerSlideshow").style.top=((slideshow)?"":"-1000px");if(slideshow){dgi("frame1").className="blackFrame";D.body.style.background="black";dd.elements.imgDiv.setDraggable(false);dd.elements.imgNextDiv.setDraggable(false);dd.elements.imgPrevDiv.setDraggable(false);dd.recalc();eval("controlSliderInit"+SLIDESHOW_TIMER_CONTROL_NAME+"()");slideshowResume()}else{slideshowPause();dgi("frame1").className="frame1";D.body.style.background="";if(winMe.isBorderless()){winMe.resetBorders()}dd.elements.imgDiv.setDraggable(true);dd.elements.imgNextDiv.setDraggable(true);dd.elements.imgPrevDiv.setDraggable(true);winMe.setCaption(defaultTitle)}winResized();submitFrm("toggleSlideshow")}function slideshowPause(){dgi("slideShowPauseBt").style.display="none";dgi("slideShowResumeBt").style.display="";slideshowRunning=0;slideShowTimer=clearTimeout(slideShowTimer)}function slideshowResume(){dgi("slideShowPauseBt").style.display="";dgi("slideShowResumeBt").style.display="none";slideshowRunning=1;slideShowTimer=setTimeout("buttonNext()",sTimeout)}function keyPressed(d){if(zooming){return}if(d.keyCode){kc=d.keyCode}else{kc=d.which}if(kc==27){winMe.closeMe()}if((kc==43||kc==107)&&zoom=="resized"){if(!slideshow&&!dd.elements.imgDiv.isLaunched){toggleZoom(1,1)}}if((kc==45||kc==109)&&zoom=="full"){if(!slideshow&&!dd.elements.imgDiv.isLaunched){toggleZoom(0,1)}}if((kc==37||kc==33||kc==178||kc==33)&&zoom=="resized"){buttonPrev()}if((kc==39||kc==34||kc==177||kc==34)&&zoom=="resized"){buttonNext()}if(kc==13){buttonNext()}if(kc==32&&slideshow){if(dgi("slideShowPauseBt").style.display=="none"){slideshowResume()}else{slideshowPause()}}else{if(kc==32){buttonNext()}}if(zoom=="full"&&((kc>36&&kc<41)||(kc>174&&kc<179)||(kc==33||kc==34))){var c=aw/4/100;if(kc==175||kc==38){dd.elements.imgDiv.launch(0,c)}if(kc==176||kc==40){dd.elements.imgDiv.launch(0,-c)}if(kc==177||kc==39){dd.elements.imgDiv.launch(-c,0)}if(kc==178||kc==37){dd.elements.imgDiv.launch(c,0)}if(kc==33){dd.elements.imgDiv.launch(0,c*4)}if(kc==34){dd.elements.imgDiv.launch(0,-c*4)}var b=dd.elements.imgDiv.x;var a=dd.elements.imgDiv.y;if((dd.elements.imgDiv.x>al||dd.elements.imgDiv.x<aw+al-w)&&fw>aw){b=Math.max(Math.min(dd.elements.imgDiv.x,al),aw+al-w)}else{if(fw<aw){b=aw/2+al-fw/2}}if((dd.elements.imgDiv.y>at||dd.elements.imgDiv.y<ah+at-h)&&fh>ah){a=Math.max(Math.min(dd.elements.imgDiv.y,at),ah+at-h)}else{if(fh<ah){a=ah/2+at-fh/2}}if(b!=dd.elements.imgDiv.x||a!=dd.elements.imgDiv.y){dd.elements.imgDiv.moveTo(b,a)}}return false}function updateOrientation(){window.scrollTo(0,1);var a=iorient();if(zoom=="resized"||!fw){if(a==0){dgn("viewport").setAttribute("content","width=320, height=416, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0, initial-scale=1");D.body.style.width="320px";D.body.style.height="416px"}if(a==1){dgn("viewport").setAttribute("content","width=480, height=268, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0, initial-scale=1");D.body.style.width="480px";D.body.style.height="268px"}}else{if(fw){dgn("viewport").setAttribute("content","width="+fw+", height="+fh+", user-scalable=yes")}}winResized();W.scrollTo(0,1)}function iorient(){return(Math.abs(window.orientation/90)%2)}function bgClick(){if(bDrag){return}if(toggleZoomLocked){return}if(mouseY<at||mouseY<dgi("headerNormal").offsetHeight*1.5||mouseY<dgi("headerSlideshow").offsetHeight*1.5){return}if(mouseX<aw/2+al){buttonPrev()}else{buttonNext()}};